package com.ittable.datasource.route.test;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

/**
 * @author srh
 * @date 2021/06/30
 **/
@Aspect
@Component
public class RTMonitorAspject {

    @Around(value = "@annotation(com.ittable.datasource.route.annotation.RTMonitor)")
    public Object around1(ProceedingJoinPoint point) throws Throwable {
        System.out.println("rt monitor pointcut");
        return point.proceed(point.getArgs());
    }

    @Around(value = "execution(* com.ittable.datasource.route.test.RTMonitorManager.*(..))")
    public Object around2(ProceedingJoinPoint point) throws Throwable {
        System.out.println("monitor all");

        return point.proceed();
    }

}
